import { message } from 'ant-design-vue';
import {Adminlogin} from "@/api/api";
import type loginType from './instanceof/loginType';
async function login(login: loginType) {
    const  res:any = await Adminlogin(login);
    if (res.code != 200) {
        message.error(res.msg);
        return false;
    }
    localStorage.setItem("userInfo", JSON.stringify(res.data))
    message.success('登录成功');
    return true;
}
export default login;